import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 订单日志
 */
@Entity('order_log')
export class OrderLogEntity extends BaseEntity {
  @Index()
  @Column({ comment: '订单ID' })
  orderId: number;

  @Column({ comment: '操作时间', type: 'datetime' })
  operationTime: Date;

  @Column({
    comment: '操作类型',
    dict: ['系统自动', '用户操作', '管理员操作'],
    default: 0,
  })
  operationType: number;

  @Column({ comment: '操作内容', type: 'text', nullable: true })
  operationContent: string;

  @Column({ comment: '操作人类型', dict: ['用户', '管理员'], default: 0 })
  operatorType: number;

  @Column({ comment: '操作人ID' })
  operatorId: number;
}
